% G = RS_GENERATOR  Create a generator for a t-error
% correcting Reed-Solomon code, using the provided add-one table for
% GF(2^m).
%
%  Output
%         G   RS code generator polynomial
%
%  Notes
%
%  The values of t and m are specified as global variables in init.m

function g = RS_generator()
    global t m

    g = 0;

    % t-error correcting --> multiply 2t consecutive (x-a^n) terms
    for i = 1 : 2*t

        poly = [i 0];
        g = polyMult(g,poly);

    end

end
